import Vue from 'vue';
import store from '../store';
// 按钮权限
Vue.directive('has', {
  inserted(el, binding) {
    const data = store.state.actionList;
    const { value } = binding;
    const hasPermissions = data.includes(value);
    if (!hasPermissions) {
      el.style.display = 'none';
      setTimeout(() => {
        el.parentElement.removeChild(el);
      }, 0);
    }
  },
});
